# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Vision.V1.Model.AnnotateImageResponse do
  @moduledoc """
  Response to an image annotation request.

  ## Attributes

  *   `context` (*type:* `GoogleApi.Vision.V1.Model.ImageAnnotationContext.t`, *default:* `nil`) - If present, contextual information is needed to understand where this image comes from.
  *   `cropHintsAnnotation` (*type:* `GoogleApi.Vision.V1.Model.CropHintsAnnotation.t`, *default:* `nil`) - If present, crop hints have completed successfully.
  *   `error` (*type:* `GoogleApi.Vision.V1.Model.Status.t`, *default:* `nil`) - If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when `error` is set.
  *   `faceAnnotations` (*type:* `list(GoogleApi.Vision.V1.Model.FaceAnnotation.t)`, *default:* `nil`) - If present, face detection has completed successfully.
  *   `fullTextAnnotation` (*type:* `GoogleApi.Vision.V1.Model.TextAnnotation.t`, *default:* `nil`) - If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text.
  *   `imagePropertiesAnnotation` (*type:* `GoogleApi.Vision.V1.Model.ImageProperties.t`, *default:* `nil`) - If present, image properties were extracted successfully.
  *   `labelAnnotations` (*type:* `list(GoogleApi.Vision.V1.Model.EntityAnnotation.t)`, *default:* `nil`) - If present, label detection has completed successfully.
  *   `landmarkAnnotations` (*type:* `list(GoogleApi.Vision.V1.Model.EntityAnnotation.t)`, *default:* `nil`) - If present, landmark detection has completed successfully.
  *   `localizedObjectAnnotations` (*type:* `list(GoogleApi.Vision.V1.Model.LocalizedObjectAnnotation.t)`, *default:* `nil`) - If present, localized object detection has completed successfully. This will be sorted descending by confidence score.
  *   `logoAnnotations` (*type:* `list(GoogleApi.Vision.V1.Model.EntityAnnotation.t)`, *default:* `nil`) - If present, logo detection has completed successfully.
  *   `productSearchResults` (*type:* `GoogleApi.Vision.V1.Model.ProductSearchResults.t`, *default:* `nil`) - If present, product search has completed successfully.
  *   `safeSearchAnnotation` (*type:* `GoogleApi.Vision.V1.Model.SafeSearchAnnotation.t`, *default:* `nil`) - If present, safe-search annotation has completed successfully.
  *   `textAnnotations` (*type:* `list(GoogleApi.Vision.V1.Model.EntityAnnotation.t)`, *default:* `nil`) - If present, text (OCR) detection has completed successfully.
  *   `webDetection` (*type:* `GoogleApi.Vision.V1.Model.WebDetection.t`, *default:* `nil`) - If present, web detection has completed successfully.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :context => GoogleApi.Vision.V1.Model.ImageAnnotationContext.t() | nil,
          :cropHintsAnnotation => GoogleApi.Vision.V1.Model.CropHintsAnnotation.t() | nil,
          :error => GoogleApi.Vision.V1.Model.Status.t() | nil,
          :faceAnnotations => list(GoogleApi.Vision.V1.Model.FaceAnnotation.t()) | nil,
          :fullTextAnnotation => GoogleApi.Vision.V1.Model.TextAnnotation.t() | nil,
          :imagePropertiesAnnotation => GoogleApi.Vision.V1.Model.ImageProperties.t() | nil,
          :labelAnnotations => list(GoogleApi.Vision.V1.Model.EntityAnnotation.t()) | nil,
          :landmarkAnnotations => list(GoogleApi.Vision.V1.Model.EntityAnnotation.t()) | nil,
          :localizedObjectAnnotations =>
            list(GoogleApi.Vision.V1.Model.LocalizedObjectAnnotation.t()) | nil,
          :logoAnnotations => list(GoogleApi.Vision.V1.Model.EntityAnnotation.t()) | nil,
          :productSearchResults => GoogleApi.Vision.V1.Model.ProductSearchResults.t() | nil,
          :safeSearchAnnotation => GoogleApi.Vision.V1.Model.SafeSearchAnnotation.t() | nil,
          :textAnnotations => list(GoogleApi.Vision.V1.Model.EntityAnnotation.t()) | nil,
          :webDetection => GoogleApi.Vision.V1.Model.WebDetection.t() | nil
        }

  field(:context, as: GoogleApi.Vision.V1.Model.ImageAnnotationContext)
  field(:cropHintsAnnotation, as: GoogleApi.Vision.V1.Model.CropHintsAnnotation)
  field(:error, as: GoogleApi.Vision.V1.Model.Status)
  field(:faceAnnotations, as: GoogleApi.Vision.V1.Model.FaceAnnotation, type: :list)
  field(:fullTextAnnotation, as: GoogleApi.Vision.V1.Model.TextAnnotation)
  field(:imagePropertiesAnnotation, as: GoogleApi.Vision.V1.Model.ImageProperties)
  field(:labelAnnotations, as: GoogleApi.Vision.V1.Model.EntityAnnotation, type: :list)
  field(:landmarkAnnotations, as: GoogleApi.Vision.V1.Model.EntityAnnotation, type: :list)

  field(:localizedObjectAnnotations,
    as: GoogleApi.Vision.V1.Model.LocalizedObjectAnnotation,
    type: :list
  )

  field(:logoAnnotations, as: GoogleApi.Vision.V1.Model.EntityAnnotation, type: :list)
  field(:productSearchResults, as: GoogleApi.Vision.V1.Model.ProductSearchResults)
  field(:safeSearchAnnotation, as: GoogleApi.Vision.V1.Model.SafeSearchAnnotation)
  field(:textAnnotations, as: GoogleApi.Vision.V1.Model.EntityAnnotation, type: :list)
  field(:webDetection, as: GoogleApi.Vision.V1.Model.WebDetection)
end

defimpl Poison.Decoder, for: GoogleApi.Vision.V1.Model.AnnotateImageResponse do
  def decode(value, options) do
    GoogleApi.Vision.V1.Model.AnnotateImageResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Vision.V1.Model.AnnotateImageResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
